#include "Processbar.h"
//void ForTest()
//{
//  printf("This is for test\n");
//  printf("This is for test\n");
//  printf("This is for test\n");
//  printf("This is for test\n");
//  printf("This is for test\n");
//  printf("This is for test\n");
//}
//
//
//
//
//
//
#define Size 101
#define Style '#'
void ProcBar(double total, double current)
{
  char Loading[4] = {'|', '/', '-', '\\' };
  char arr[101];
  memset(arr, '\0', sizeof(arr));
  double rate =current*100.0 / total; 
  int progress = (int)rate;
  int i = 0;
  while(i <= progress)
  {
    arr[i++] = Style;
  }
    printf("[%-101s][%.1lf%%][%c]\r", arr,rate , Loading[i%4]);
    fflush(stdout);
}
